package com.ruoyi.jihuo.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.jihuo.domain.JhSysTrafficRecord;
import com.ruoyi.jihuo.domain.TrafficCount;
import com.ruoyi.jihuo.service.IJhReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/jihuo/report")
public class JhReportController extends BaseController {
    @Autowired
    private IJhReportService reportService;

    /**
     * trafficDaily
     */
    @GetMapping("/trafficDaily")
    public TableDataInfo trafficDaily() {
        //startPage();
        List<TrafficCount> list = reportService.trafficDaily();
        return getDataTable(list);
    }

    /**
     * trafficWeekly
     */
    @GetMapping("/trafficWeekly")
    public TableDataInfo trafficWeekly() {
        //startPage();
        List<TrafficCount> list = reportService.trafficWeekly();
        return getDataTable(list);
    }

    /**
     * trafficMonthly
     */
    @GetMapping("/trafficMonthly")
    public TableDataInfo trafficMonthly() {
        //startPage();
        List<TrafficCount> list = reportService.trafficMonthly();
        return getDataTable(list);
    }

    /**
     * trafficMonthly
     */
    @GetMapping("/getTodayTraffic")
    public TableDataInfo getTodayTraffic() {
        //startPage();
        List<TrafficCount> list = reportService.getTodayTraffic();
        return getDataTable(list);
    }

    @GetMapping("/getThisWeekTraffic")
    public TableDataInfo getThisWeekTraffic() {
        //startPage();
        List<TrafficCount> list = reportService.getThisWeekTraffic();
        return getDataTable(list);
    }

    @GetMapping("/getThisMonthTraffic")
    public TableDataInfo getThisMonthTraffic() {
        //startPage();
        List<TrafficCount> list = reportService.getThisMonthTraffic();
        return getDataTable(list);
    }

    @GetMapping("/getTodaySales")
    public TableDataInfo getTodaySales() {
        //startPage();
        List<JhSysTrafficRecord> list = reportService.getTodaySales();
        return getDataTable(list);
    }

    @GetMapping("/getThisWeekSales")
    public TableDataInfo getThisWeekSales() {
        //startPage();
        List<JhSysTrafficRecord> list = reportService.getThisWeekSales();
        return getDataTable(list);
    }

    @GetMapping("/getThisMonthSales")
    public TableDataInfo getThisMonthSales() {
        //startPage();
        List<JhSysTrafficRecord> list = reportService.getThisMonthSales();
        return getDataTable(list);
    }
}
